//
//  PolygonShapeTest.m
//  HelloPoly
//
//  Created by mstevens on 10/12/09.
//  Copyright 2009 __MyCompanyName__. All rights reserved.
//

#import "PolygonShapeTest.h"


@implementation PolygonShapeTest

- (void)setUp {
	[super setUp];
	shape = [[PolygonShape alloc] init];
}
- (void)tearDown {
	[shape autorelease];
	[super tearDown];
}

- (void) testInit {
	STAssertEquals(4, [shape numberOfSides],
				   @"Expected %d but was %d instead", 4, [shape numberOfSides]);
	STAssertEquals(3, [shape minimumNumberOfSides],
				   @"Expected %d but was %d instead", 3, [shape minimumNumberOfSides]);
	STAssertEquals(10, [shape maximumNumberOfSides],
				   @"Expected %d but was %d instead", 10, [shape maximumNumberOfSides]);
}

- (void) testInitWithNumberOfSides {
	[shape initWithNumberOfSides:8 minimumNumberOfSides:5 maximumNumberOfSides:9];
	STAssertEquals(8, [shape numberOfSides],
				   @"Expected %d but was %d instead", 8, [shape numberOfSides]);
	STAssertEquals(5, [shape minimumNumberOfSides],
				   @"Expected %d but was %d instead", 5, [shape minimumNumberOfSides]);
	STAssertEquals(9, [shape maximumNumberOfSides],
				   @"Expected %d but was %d instead", 9, [shape maximumNumberOfSides]);
	
	[shape initWithNumberOfSides:2 minimumNumberOfSides:1 maximumNumberOfSides:20];
	STAssertEquals(3, [shape numberOfSides],
				   @"Expected %d but was %d instead", 3, [shape numberOfSides]);
	STAssertEquals(3, [shape minimumNumberOfSides],
				   @"Expected %d but was %d instead", 3, [shape minimumNumberOfSides]);
	STAssertEquals(12, [shape maximumNumberOfSides],
				   @"Expected %d but was %d instead", 12, [shape maximumNumberOfSides]);
	
	[shape initWithNumberOfSides:4 minimumNumberOfSides:5 maximumNumberOfSides:11];
	STAssertEquals(5, [shape numberOfSides],
				   @"Expected %d but was %d instead", 5, [shape numberOfSides]);
	STAssertEquals(5, [shape minimumNumberOfSides],
				   @"Expected %d but was %d instead", 5, [shape minimumNumberOfSides]);
	STAssertEquals(11, [shape maximumNumberOfSides],
				   @"Expected %d but was %d instead", 11, [shape maximumNumberOfSides]);
	
}

@end
